import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Gao zhao xu
 * Date: 2023-10-12
 * Time: 17:27
 */
public class test {
    public static void main(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        System.out.println("1.===========================");
        //如队列
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        System.out.println(queue);
        System.out.println("2.===========================");
        //出队列
        System.out.println(queue.poll());
        System.out.println(queue);
        System.out.println("3.===========================");
        //获取队列顶层元素，与栈一致
        System.out.println(queue.peek());
        System.out.println(queue);
        System.out.println("4.===========================");
        //判空
        System.out.println(queue.isEmpty());
        System.out.println("5.===========================");
        System.out.println(queue.size());
        System.out.println("6.===========================");
    }
}
